Defined in: src/aspects/required-tags-checker/required-tags-checker.ts:23
CDK aspect that checks for the presence of required tags on a stack.
This aspect can be applied to a CDK app or stack to enforce tagging policies. It validates that:
- The stack has at least one tag.
- All specified required tags are present.
If any required tags are missing or no tags are found, an error annotation is added to the stack.
Example
import { RequiredTagsChecker } from './aspects/required-tags-checker';
import { appRequiredTags } from './tags';
cdk.Aspects.of(this).add(new RequiredTagsChecker(appRequiredTags));
Implements
Implements
IAspect
Constructors
Constructor
new RequiredTagsChecker(
requiredTags):RequiredTagsChecker
Defined in: src/aspects/required-tags-checker/required-tags-checker.ts:29
Creates a new RequiredTagsChecker.
Parameters
requiredTags
A list of tag keys that must be present on the stack.
Returns
RequiredTagsChecker
Methods
visit()
visit(
node):void
Defined in: src/aspects/required-tags-checker/required-tags-checker.ts:36
Visits each construct in the CDK app and performs tag validation on stacks.
Parameters
node
IConstruct
The construct being visited.
Returns
void
Implementation of
IAspect.visit